import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        int count=0;
        for (int i = 1; i <=32; i++) {
            if(((a>>i)&1)==1){
                count++;
            }
        }
        System.out.println(count);
    }
    public static void main6(String[] args) {
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        int b=in.nextInt();
        while(b!=0){
            int tmp=b;
            b=a%b;
            a=tmp;
        }
        System.out.println(a);
    }
    public static void main5(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int tmp=n;
        int sum=0;
        int count=0;
        for (int i = 1; i < n; i*=10) {
            tmp/=10;
            count++;
        }
        System.out.println(count);
        int flag=count;
        int x=n;
        while (count!=0){
            int y=x%10;
            x/=10;
            sum+=Math.pow(y, flag);
            count--;
        }
        System.out.println(sum);
        if(sum==n){
            System.out.println(n+"是水仙花数");
        }
        else{
            System.out.println(n+"不是水仙花数");
        }
    }
    public static void main4(String[] args) {
        double sum=0.0;
        int tmp=1;
        for (int i = 1; i <101 ; i++) {
            sum+=1.0/(i*tmp);
            tmp=-tmp;
        }
        System.out.println(sum);
    }
    public static void main3(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int flag=0;
        for (int i = 2; i < n-1; i++) {
            if(n%i==0){
                flag=1;
            }
        }
        if(flag==1){
            System.out.println(n+"不是素数");
        }
        else{
            System.out.println(n+"是素数");
        }
    }
    public static void main2(String[] args) {
        for (int i = 0; i < 100; i++) {
            if(i/10==9||i%10==9){
                System.out.print(i);
                System.out.print(" ");
            }
        }
    }
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int a=in.nextInt();
        for(int i=0;i<a;i++){
            for(int j=0;j<a;j++){
                if(i==j||(i+j)==a-1){
                    System.out.print("*");
                }
                else{
                    System.out.print(" ");
                }

            }
            System.out.print("\n");
        }
    }
}

